package com.joyintech.modules.pmp.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.joyintech.annotation.Dict;
import com.joyintech.base.CommonEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
* @author daiweiwei
* @date 2021-09-27
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("ds_app")
public class DsApp extends CommonEntity<DsApp> implements Serializable {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "项目名称")
    @NotBlank
    private String name;

    @ApiModelProperty(value = "项目简介")
    @NotBlank
    private String appDesc;

    @ApiModelProperty(value = "甲方项目经理")
    @NotNull
    private Long pmpA;

    @ApiModelProperty(value = "乙方项目经理")
    @NotNull
    private Long pmpB;

    @ApiModelProperty(value = "gitlab路径")
    private String gitlabUrl;

    @ApiModelProperty(value = "预计上线日期")
    @NotNull
    private Date onlineTime;

    @ApiModelProperty(value = "关联项目需求编号")
    private String prdId;

    public void copyFrom(DsApp source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
